package com.template.config.mybatisflex;

import com.mybatisflex.core.FlexGlobalConfig;
import com.mybatisflex.core.audit.AuditMessage;
import com.mybatisflex.core.audit.MessageReporter;
import com.mybatisflex.core.mybatis.FlexConfiguration;
import com.mybatisflex.spring.boot.ConfigurationCustomizer;
import com.mybatisflex.spring.boot.MyBatisFlexCustomizer;
import com.mybatisflex.spring.boot.SqlSessionFactoryBeanCustomizer;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class MybatisFlexConfig implements ConfigurationCustomizer,
        SqlSessionFactoryBeanCustomizer,
        MyBatisFlexCustomizer,
        MessageReporter {

    @Override
    public void customize(SqlSessionFactoryBean sqlSessionFactoryBean) {
        System.out.println("SqlSessionFactoryBean 配置！");
    }

    @Override
    public void customize(FlexConfiguration flexConfiguration) {
        System.out.println("Mybatis Configuration 配置！");
    }

    @Override
    public void customize(FlexGlobalConfig flexGlobalConfig) {
        System.out.println("Mybatis Flex 配置！");
    }

    @Override
    public void sendMessages(List<AuditMessage> list) {

    }
}
